package com.atguigu.gmall.order.service;

import com.atguigu.gmall.model.mq.to.ware.WareDeductMsg;
import com.atguigu.gmall.model.order.entity.OrderInfo;
import com.atguigu.gmall.model.order.vo.OrderConfirmVo;
import com.atguigu.gmall.model.order.vo.OrderSplitParamVO;
import com.atguigu.gmall.model.order.vo.OrderSplitResultVO;
import com.atguigu.gmall.model.order.vo.OrderSubmitVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
* @author jiamin
* @description 针对表【order_info(订单表 订单表)】的数据库操作Service
* @createDate 2023-09-03 14:02:14
*/
public interface OrderInfoService extends IService<OrderInfo> {

    /**
     * 获取订单页面需要的数据
     * @return
     */
    OrderConfirmVo getOrderConfirmVo();

    /**
     * 保存订单，生成订单号
     * @param tradeNo
     * @param orderSubmitVo
     * @return
     */
    Long submitOrder(String tradeNo, OrderSubmitVo orderSubmitVo);

    OrderInfo getOrderInfo(Long orderId);

    void cancelOrder(Long orderId, Long userId);

    /**
     * 修改订单状态为已支付
     */
    void updateOrderStatusPayed(Map<String, String> stringStringMap);

    void updateOrderStock(WareDeductMsg msg);

    List<OrderSplitResultVO> orderSplit(OrderSplitParamVO orderSplitParamVO);
}
